package com.zhangxujie.litewords.ui;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;

import com.zhangxujie.litewords.R;
import com.zhangxujie.litewords.api.Const;
import com.zhangxujie.litewords.entity.SettingItem;

import java.util.List;

//弃用
@Deprecated
public class SettingActivity extends AppCompatActivity {

    private SharedPreferences mSpf;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.deprecated_setting_activity);
        mSpf = super.getSharedPreferences("setting", MODE_PRIVATE);

        initListener();

        final Context ctx = this;

//        final List<SettingItem> settingInfos = new ArrayList();
//
//        initSettingInfos(settingInfos);

//        final ListView settingList = findViewById(R.id.setting_list);
//
//        settingSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
//            @Override
//            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
//                System.out.println("!!!!!!!!!!!!");
//                SharedPreferences.Editor editor = mSpf.edit();
//                editor.putInt(Const.SETTING_RECITE_SETTINGBAR, isChecked ? 1 : 0);
//                editor.apply();
//                Log.d("sig:setting", "onCheckedChanged: "+isChecked);
//            }
//        });


    }


    private void initListener() {



    }


    private void initSettingInfos(List<SettingItem> settingInfos) {

        settingInfos.add(new SettingItem(
                "是否开启背单词页面Seting-Bar",
                mSpf.getInt(Const.SETTING_RECITE_SETTINGBAR, 1),
                Const.SETTING_RECITE_SETTINGBAR));

    }


}